#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    mybutton = new QPushButton(this);
    mybutton->setText("Hi Celia!");
    connect(mybutton, &QPushButton::clicked, this, &Widget::HandelButton);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::HandelButton()
{
    if(mybutton->text() == QString("Hi Celia!")){
        mybutton->setText("Hi Qt!");
    }else{
        mybutton->setText("Hi Celia!");
    }
}

